<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/list.css">
</head>
<style>
    .gouyao {
        padding: 0 0.8rem;
        background-color: #fff;
    }

    .gouyao .gouyao_btn {
        width: 100%;
        background-color: #2780e8;
        font-size: 0.7rem;
        color: #fff;
        height: 2.2rem;
        text-align: center;
        border-radius: 0.2rem;
        margin-bottom: 1rem;
    }

    .gouyao .gouyao_btn p:last-child {
        color: #FFCECB;
        font-size: 0.6rem;
    }

    .chufang {
        padding: 0.8rem;
        background-color: #fff;
    }

    .chufang .chufang_title {
        color: #303030;
        font-size: 0.7rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid #e8e8e8;
    }

    .chufang .chufang_title span {
        color: #2780e8;
        float: right;
    }

    .yaodian {
        width: 100%;
        height: 2rem;
        padding: 0.8rem 0;
    }

    .yaodian img {
        width: 2rem;
        height: 100%;
    }

    .yaodian .yaodian_info {
        float: right;
        width: 14.5rem;
        height: 100%;
    }

    .yaodian .yaodian_name {
        color: #303030;
        font-size: 0.6rem;
    }

    .yaodian .yaodian_other {
        margin-top: 0.2rem;
        color: #838383;
        font-size: 0.5rem;
    }

    .yaocai {
        width: 100%;
        background-color: #FFF4F3;
        border-top: 1px solid #e7e7e5;
    }

    .yaocai .yaocai_item {
        display: inline-block;
        width: 33.3%;
        margin-left: -0.25rem;
        height: 2.5rem;
        line-height: 2.5rem;
        text-align: center;
        color: #565656;
        font-size: 0.7rem;
    }

    .yizhu {
        padding: 0 0.8rem;
        background-color: #fff;
    }

    .yizhu .yizhu_title {
        color: #565656;
        font-size: 0.7rem;
        padding: 0.8rem 0;
        border-bottom: 1px solid #e8e8e8;
    }

    .yizhu textarea {
        width: 100%;
        padding: 0.8rem 0;
        font-size: 0.7rem;
        color: #565656;
        height: 5.4rem;
        outline: none;
    }

    .now_buy {
        margin-top: 1rem;
        width: 100%;
        height: 2.5rem;
        text-align: center;
        line-height: 2.5rem;
        color: #fff;
        background-color: #2780e8;
        font-size: 0.8rem;
    }

    .img_div {
        width: 100%;
        margin-bottom: 0.3rem;
        text-align: center;
    }

    .img_div img {
        width: 8rem;
        height: 8rem;
        margin: 0 0.4rem;
        background-color: #ccc;
        /* 清除img标签留白 */
        vertical-align: middle;
    }
</style>

<body>
    <div  id="app" v-cloak>
        <div class="placeholder_div"></div>

        <!-- <div class="gouyao">
            <div class="gouyao_btn openwin" data-win="qugouyao_win">
                <p>未购药</p>
                <p>代患者购药</p>
            </div>
        </div> -->
        <div class="aui-content aui-margin-b-15">
            <ul class="aui-list aui-list-in">
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-title">患者姓名</div>
                        <div class="aui-list-item-right">{{info.name}}</div>
                    </div>
                </li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-title">拍方时间</div>
                        <div class="aui-list-item-right">{{info.createTime}}</div>
                    </div>
                </li>
            </ul>
        </div>

        <div class="img_div"  v-if="imgs">
            <img :src="image_http+imgs" alt="处方">
        </div>

        <div class="placeholder_div" style="border-bottom: 1px solid #e8e8e8;"></div>
        <!-- 处方 -->
        <div class="chufang">
            <p class="chufang_title">
                药房
            </p>
            <div class="yaodian">
                <img :src="image_http+storeLogo" alt="" v-if="storeLogo">
                <img src="../image/store.png" alt="" v-else>
                <div class="yaodian_info">
                    <p class="yaodian_name">{{info.store}}</p>
                </div>
            </div>
        </div>

        <div class="yaocai" v-if="info.visible == 1 && info.drugsList">
            <div class="yaocai_item"  v-for="item in info.drgusList">
                {{item.drugs_name}} {{item.quantity}}g
            </div>
        </div>

        <div class="aui-content aui-margin-b-15">
            <ul class="aui-list aui-list-in">

                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-title">当药前处方是否可见</div>
                        <div class="aui-list-item-right" v-if="info.visible == 1">可见</div>
                        <div class="aui-list-item-right" v-else>不可见</div>
                    </div>
                </li>

                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-title">诊金</div>
                        <div class="aui-list-item-right">￥{{info.billingMoney}}</div>
                    </div>
                </li>

            </ul>
        </div>
        <div class="placeholder_div"></div>
        <!-- <div class="now_buy openwin" data-win="pay_win">发送患者</div> -->
    </div>
</body>

</html>
<script src="../script/set_root.js"></script>

<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/zepto.min.js"></script>
<script type="text/javascript" src="../script/hb.js"></script>
<script type="text/javascript" src="../script/vue.js"></script>
<script type="text/javascript">
    apiready = function () {
        hb_ready();

        get_ajax("prescribe/plan-photo/view", {
            id: api.pageParam.id
        }, function (res, err) {
            if (res.code == 200) {
                // alert(JSON.stringify(res))
                app.info = res.data
                if(res.data.prescription){
                  app.imgs = res.data.prescription
                }

                get_ajax("store/view",{
                  id: res.data.storeId
                },function(ret, err){
                  if (ret.code == 200) {
                      app.storeLogo = ret.data.logo ? ret.data.logo.replace(IMAGE_HTTP, "") : "";
                  }
                })
            }
        })
    }
    //使用vue对数据进行绑定
    var app = new Vue({
        el: '#app',
        data: {
            info: "",
            storeLogo: "",
            imgs:"",
            image_http: IMAGE_HTTP
        },
        methods: {

        },

    })
</script>
